<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Libs\ConfModel;

final class ProjectConf extends ConfAbstract
{
    public const PREFIX                         = 'PRO.';               // 配置前缀[必定点结尾]
    protected bool $release                     = false;                // 是否正式环境
    protected string $serverName                = '';                   // 服务名称
    protected string $name                      = '';                   // 项目名称
    protected string $version                   = '';                   // 项目版本
    protected string $dataPath                  = '';                   // 数据可写目录
    protected string $logPath                   = '';                   // 日志可写目录
    protected string $tmpPath                   = '';                   // 临时可写目录

    /**
     * @param array $confData
     */
    public function __construct(array $confData)
    {
        $this->init($confData);
    }

    /**
     * @return bool
     */
    public function isRelease(): bool
    {
        return $this->release;
    }

    /**
     * @return string
     */
    public function getServerName(): string
    {
        return $this->serverName;
    }

    /**
     * @return string
     */
    public function getName(): string
    {
        return $this->name;
    }

    /**
     * @return string
     */
    public function getVersion(): string
    {
        return $this->version;
    }

    /**
     * @return string
     */
    public function getDataPath(): string
    {
        return $this->dataPath;
    }

    /**
     * @return string
     */
    public function getLogPath(): string
    {
        return $this->logPath;
    }

    /**
     * @return string
     */
    public function getTmpPath(): string
    {
        return $this->tmpPath;
    }
}